<template>
  <div class="song_wrapper">
    <ul class="song_list">
      <li @click="activeMusic(item.id,index)" v-for="(item, index) in list" :key="index" :class="{active:indexAtc==index}">
        {{ item.name }}--<span
          v-for="(item1, index1) in item.artists"
          :key="index1">{{ item1.name }}</span>
      </li>
    </ul>
  </div>
</template>

<script>
export default {
  data() {
    return {
      list: [],
      indexAtc:null
    };
  },
  methods: {    
      activeMusic(id,index){
          this.$parent.listenToMusic(id) 
          this.$parent.getcomment(id)
          this.$parent.getdetail(id)
          this.indexAtc=index
      }
  },
};
</script>

<style>
</style>